package com.joysuch.wwyt.risk.service.impl;

import com.joysuch.wwyt.common.constant.Constant;
import com.joysuch.wwyt.core.support.Context;
import com.joysuch.wwyt.risk.entity.RiskHiddenDangerContent;
import com.joysuch.wwyt.risk.mapper.RiskHiddenDangerContentMapper;
import com.joysuch.wwyt.risk.service.RiskHiddenDangerContentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author heqifeng
 * @since 2021-09-13
 */
@Service
public class RiskHiddenDangerContentServiceImpl extends ServiceImpl<RiskHiddenDangerContentMapper, RiskHiddenDangerContent> implements RiskHiddenDangerContentService {

    @Autowired
    private RiskHiddenDangerContentMapper riskHiddenDangerContentMapper;

    @Override
    public List<Long> findIdsByRiskPoints(List<Long> riskPointIds) {
        return riskHiddenDangerContentMapper.findIdsByRiskPoints(riskPointIds);
    }

    @Override
    public List<RiskHiddenDangerContent> findByDetailId(Long detailId) {
        if (detailId == null) {
            return null;
        }
        return riskHiddenDangerContentMapper.findByDetailId(detailId);
    }


    @Override
    public List<RiskHiddenDangerContent> findAll() {
        return riskHiddenDangerContentMapper.findAll(Context.getCurrentTenantId(), Context.getCurrentOrgCode());
    }

    @Override
    public void removeByDetailIds(List<Long> detailIds) {
        riskHiddenDangerContentMapper.removeByDetailIds(detailIds);
    }

    @Override
    public Long getRiskPointById(Long id) {
        return riskHiddenDangerContentMapper.selectRiskPointIdById(id);
    }

    @Override
    public Long getEvaluationIdById(Long id) {
        return riskHiddenDangerContentMapper.selectEvaluationIdById(id);
    }
}
